const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const utils = require('./src/js/utils.js');
var config = require('./webpack.config.js');

var newconfig = utils.extendObj(config, {
    entry: './test/turnable.js',
    output: {
        filename: 'turntable.min.js',
        path: path.resolve(__dirname, 'example'),
        publicPath: path.resolve(__dirname, 'example')
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: '转盘游戏',
            filename: 'index.html',
            template: 'index.html',
            path: path.resolve(__dirname, 'example'),
        }),
        new webpack.HotModuleReplacementPlugin()
    ],
    devServer: {
        contentBase: path.join(__dirname, "example"),
        compress: true,
        port: 9888,
        hot: true
    },
});
module.exports = newconfig;